/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package src.Ultil;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import src.pojo.Catagory;
import src.pojo.Products;

/**
 *
 * @author LeMinh
 */
public class DBUltilities {

    public static Connection getConnection() {
        Connection con = null;
        try {
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            String url = "jdbc:sqlserver://localhost:1433;databaseName=XMLProjectData;instanceName=NHUTLMSE60607";
            con = DriverManager.getConnection(url, "sa", "12345");
            return con;
        } catch (SQLException ex) {
            Logger.getLogger(DBUltilities.class.getName()).log(Level.SEVERE, null, ex);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(DBUltilities.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }

//    public static boolean saveCatagory(List<Catagory> cata) {
//        return false;
//    }

    public static boolean saveProduct(Products listProduct) {
        return false;
    }
}
